package com.coolgor.coldot.enums.wechat.qyh;

public enum QYHAccessTokenStateEnum {
	SUCCESS(1, "创建成功"), 
	NULL(-1001, "操作失败"), 
	INNER_ERROR(-1002, "操作失败"), 
	EMPTY_LIST(-1003, "添加数少于1");

	private int state;

	private String stateInfo;

	private QYHAccessTokenStateEnum(int state, String stateInfo) {
		this.state = state;
		this.stateInfo = stateInfo;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public static QYHAccessTokenStateEnum stateOf(int index) {
		for (QYHAccessTokenStateEnum state : values()) {
			if (state.getState() == index) {
				return state;
			}
		}
		return null;
	}
}
